var WebSocketServer = require('ws').Server,
wss = new WebSocketServer({ port: 8080 });
wss.on('connection', function (ws) {
    console.log("连接成功"); 
    ws.on('message', function (message) {
        console.log("收到消息"+message);
		ws.send("socket服务器返回的消息");
    });

});